package com.ziqikeji.xianyan.entity.follow;

import com.ziqikeji.xianyan.common.BaseEntity;
import com.ziqikeji.xianyan.entity.user.User;

import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * 关注 entity
 * @author liuyu
 */
@Entity
@Table(name = "follow")
public class Follow extends BaseEntity {

    /**
     * 关注人的ID
     */
    private User fans;
    /**
     * 被关注人的ID
     */
    private User followed;

    @ManyToOne
    @JoinColumn(name = "fans_id")
    public User getFans() {
        return fans;
    }

    public void setFans(User fans) {
        this.fans = fans;
    }

    @ManyToOne
    @JoinColumn(name = "followed_id")
    public User getFollowed() {
        return followed;
    }

    public void setFollowed(User followed) {
        this.followed = followed;
    }
}
